﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace MauricioAdminUI
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnLogar_Click(object sender, EventArgs e)
        {
            SindSaudeCamadas.Dados.Login LoginRE = new SindSaudeCamadas.Dados.Login();
            int idLogin = 0;
            if (txtNome.Text != "" && txtSenha.Text != "")
            {
                idLogin = LoginRE.login(txtNome.Text.ToString(),txtSenha.Text.ToString());
                if (idLogin > 0)
                {
                    Session["idLogin"] =  idLogin;
                    Response.Redirect("Default.aspx"); 
                }
            }
        }
    }
}